<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="bbs2.service.UserService" %>

<div class="container">
    <% if (UserService.isCurrentUserLoggedIn(session) == false) { %>
        <div class="navbar">
            <div class="navbar-inner">
                <div class="container">
                    <a class="brand" href="/bbs2">성공회대학교</a>
                    <div class="nav-collapse collapse">
                        <ul class="nav pull-right">
                            <li><a href='/bbs2/guest/login.jsp'>로그인</a></li>
                            <li><a href='/bbs2/guest/reset.jsp'>비밀번호찾기</a></li>
                            <li><a href='/bbs2/guest/register.jsp'>회원가입</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    <% } else { %>
        <div class="navbar">
            <div class="navbar-inner">
                <div class="container">
                    <a class="brand" href="/bbs2">성공회대학교</a>
                    <div class="nav-collapse collapse">
                        <ul class="nav">
                            <li class="dropdown">
                                <a class="dropdown-toggle" data-toggle="dropdown">게시판<b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href='/bbs2/bbs/list.jsp?bid=1'>공지사항</a></li>
                                    <li><a href='/bbs2/bbs/list.jsp?bid=2'>자유게시판</a></li>
                                    <% if (UserService.isCurrentUserAdmin(session)) { %> 
                                        <li class="divider"></li>
                                        <li><a href='/bbs2/bbsAdmin/list.jsp'>게시판 목록</a></li>
                                    <% } %>
                                </ul>
                            </li>
                            <% if (UserService.isCurrentUserAdmin(session)) { %> 
                                <li class="dropdown">
                                    <a class="dropdown-toggle" data-toggle="dropdown">시스템관리<b class="caret"></b></a>
                                    <ul class="dropdown-menu">
                                        <li><a href='/bbs2/user/list.jsp'>사용자 관리</a></li>
                                        <li><a href='/bbs2/userGroup/list.jsp'>사용자그룹 관리</a></li>
                                        <li><a href='/bbs2/log/list.jsp'>로그기록</a></li>
                                    </ul>
                                </li>
                            <% } %>
                        </ul>
                        <ul class="nav pull-right">
                            <li><a href='/bbs2/me/mypage.jsp'><%= UserService.getCurrentUserName(session) %> 정보수정</a></li>
                            <li><a href='/bbs2/me/logout.jsp'>로그아웃</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>    
    <% } %>
</div>    